package dao;

import entity.User;
import exception.DataAccessException;
import org.apache.ibatis.annotations.Param;
import vo.UserBackVo;

import java.util.Date;
import java.util.List;

/**
 * @author Shao Liwei
 * @date 2021/1/11 14:30
 * description:
 */
public interface UserDao {

    List<User> queryUsers(@Param("userVo") UserBackVo userVo);

    User queryUserById(@Param("id") String id);

    int changeUser(@Param("id") String id,@Param("nickname") String nickname,@Param("role") String role,@Param("password")String password,@Param("email")String email);

    int loginBack(@Param("loginName") String loginName,@Param("passWord") String password);

    User queryUser(@Param("loginName") String loginName,@Param("passWord") String password,@Param("role")String role);

    User selectByLoginName(String login_name) throws DataAccessException;

    User selectByEmail(String email) throws DataAccessException;

    int insertUser(User user) throws DataAccessException;

    User selectById(Integer id) throws DataAccessException;

    int updateLoginDateById(@Param("id") Integer id, @Param("login_date") Date login_date) throws DataAccessException;

    int updateUserById(User user) throws DataAccessException;

    int changeStatus(@Param("id") String id,@Param("status") String status);

    User selectDetailGPById(int id);
}
